﻿[ExportTemplate]
$USING_NAMESPACES$

namespace $NAMESPACE$
{
	public partial class $CLASS$ 
		: XPage
		, IMasterView
	{
		protected void BtnQuery_Click(object sender, EventArgs e)
		{
			// 將頁數設定為第一頁(PageIndex=0)
			grvMaster.PageIndex = 0;

			QueryMaster();
		}

		#region IMasterView 成員

		void IMasterView.SetSelectParameters()
		{
			//throw new NotImplementedException();
			
			// 清空原先的查詢條件
			MasterBLL.SelectParameters.Clear();

			// 重設查詢條件
			MasterBLL.SelectParameters["隨便設定"] = "隨便設定";
		}

		void IMasterView.DoDataBind()
		{
			grvMaster.SelectedIndex = -1;

			grvMaster.DataBind();
		}

		object IMasterView.GetUI()
		{
			return grvMaster;
		}

		object IMasterView.GetDataSource()
		{
			return dsMaster;
		}

		Type IMasterView.GetDalType()
		{
			return typeof($DAL_CLASS$);
		}

		object IMasterView.BLL
		{
			get { return MasterBLL; }
		}

		private $BLL_CLASS$ _MasterBLL;
		private $BLL_CLASS$ MasterBLL
		{
			get
			{
				_MasterBLL = _MasterBLL ?? new $BLL_CLASS$();

				return _MasterBLL;
			}
		}

		#endregion
	}
}
----------------------------------------------------------------------